import myAxios from "../plugins/myAxios";


/**
 * 获取今天日记内容
 */
export const getDiaryContent = async (date: string) => {
    const res = await myAxios.get(`/diary/list?date=${date}`);
    // @ts-ignore
    if (res.code === 0) {
        res.data.map(one => {
            one.photograph = JSON.parse(one.photograph);
        })
        return res.data;
    }
    return null;
}
export type DiaryType = {
    id: number,
    userId: number,
    weather: string,
    mood: string,
    photograph: string[],
    title: string,
    content: string
}